<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function parseQueryString(url) {
		   var params = {};
           var arr=url.indexOf('?')
            
		   var arr1 = url.substr(arr+1).split('&');
		   for(var i = 0, l = arr1.length; i < l; i++) {
		      var key = arr1[i].split("=");
		       params[key[0]] = key[1];
		   }
		    return params;
		}
        var url = "http://www.baidu.com?a=0&b=1&c=2";
		var ps = parseQueryString(url);
         console.log(ps)
		
    </script>
</body>
</html>